//
//  App_NameHandler.swift
//  mall-ios
//
//  Created by Meak Tsui on 2018/11/27.
//  Copyright © 2018 Meak Tsui. All rights reserved.
//

import Foundation
import MTHybrid

extension Api {
    static let AppName = Api("name")
}

class App_NameHandler: MTEventHandler {
    var ns: Ns {
        return .App
    }
    
    var action: Api {
        return .AppName
    }
    
    func handler(_ msg: MTHybridMsg) {
        let name = Bundle.main.infoDictionary?["CFBundleDisplayName"] as? String
        msg.callbackClosure?(name ?? "")
    }
}
